const Controller = require("egg").Controller;

class BaseController extends Controller {
    success(data) {
        this.ctx.body = {
            code: 200,
            message: 'success',
            body: data
        }
    }
    
    fail(err) {
        console.log(err);
        this.ctx.status = 500;
        this.ctx.body = {
            code: 500,
            message: "Internet Server Error"
        }
    }
}

module.exports = BaseController;